package com.pactera.madp.admin.api.feign;

import com.pactera.madp.admin.api.dto.WxDeptDto;
import com.pactera.madp.admin.api.dto.WxEmpDto;
import com.pactera.madp.admin.api.vo.WxEmpVo;
import com.pactera.madp.common.core.constant.SecurityConstants;
import com.pactera.madp.common.core.constant.ServiceNameConstants;
import com.pactera.madp.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 企业微信远程操作服务
 */
@FeignClient(contextId = "remoteWxService", value = ServiceNameConstants.CP_SERVICE)
public interface RemoteWxService {

    /**
     * 创建部门
     * @return
     */
    @PostMapping("/workdepartment")
    R<Integer> createDept(@RequestBody WxDeptDto dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 更新部门
     * @return
     */
    @PutMapping("/workdepartment")
    R<Boolean> updateDept(@RequestBody WxDeptDto dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 删除部门
     * @return
     */
    @DeleteMapping("/workdepartment/{wxDeptId}")
    R<Boolean> deleteDept(@PathVariable("wxDeptId") Integer wxDeptId, @RequestHeader(SecurityConstants.FROM) String from);


    /**
     * 查询成员
     * @param mobile
     * @param from
     * @return
     */
    @GetMapping("/workemployee/check/{mobile}")
    R<WxEmpVo> getEmp(@PathVariable("mobile") String mobile, @RequestHeader(SecurityConstants.FROM) String from);
    /**
     * 创建成员
     * @return
     */
    @PostMapping("/workemployee")
    R<Boolean> createEmp(@RequestBody WxEmpDto dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 更新成员
     * @return
     */
    @PutMapping("/workemployee")
    R<Boolean> updateEmp(@RequestBody WxEmpDto dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 删除成员
     * @return
     */
    @DeleteMapping("/workemployee/{userid}")
    R<Boolean> deleteEmp(@PathVariable("userid") String userid, @RequestHeader(SecurityConstants.FROM) String from);

}
